#include <iostream>

int main(int argc, char const *argv[])
{
    int N = 9;
    int arr[N] = {4, 2, 8, 0, 5, 7, 1, 3, 9};

    for (int i = N; i >= 0; i--)
    {
        for (int j = 0; j < i - 1; j++)
        {
            if (arr[j + 1] < arr[j])
            {
                int temp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = temp;
            }
        }
    }

    for (int i = 0; i < N; i++) {
        std::cout << arr[i] << " ";
    }

    std::cout << std::endl;

    return 0;
}
